#ifndef WEIGHTTHREAD_H
#define WEIGHTTHREAD_H

#include <QSerialPort>
#include <QVector>
#include <QByteArray>
#include <QString>
#include <QDebug>
#include <QThread>
class WEIGHTThread : public QThread
{
    Q_OBJECT
public:
    explicit WEIGHTThread(QObject *parent = nullptr);
    ~WEIGHTThread();
    bool open();
    void stop();
    int sendCommand(QVector<unsigned char> command);

protected:
    void run() override;

signals:
    void curNum(int bar, QString curtime, int weight);
private:
    bool isrunning = true;
    QSerialPort* serialPort;
signals:

};

#endif // WEIGHTTHREAD_H
